/*
    Project:        Home Power Control
    File:           HPCLogFile.h
    Author:         christian@karunamusic.at
    Date:           12.2014
    Description:    Log to file.
 */

#ifndef HPCLOGFILE_H
#define HPCLOGFILE_H

#include <iostream>
#include "HPCLogDevice.h"


class HPCLogFile : public HPCLogDevice
{
public:
    /** \brief Constructor
     * \param lv The loglevel.
     * \param fn The name of the logfile.
     *
     */
    HPCLogFile( const TLogLevel lv, const std::string& fn );
    /** \brief Destructor
     */
    virtual ~HPCLogFile();

    /** \brief Callback method for the logmessage.
     * Print given logmessage to the logfile.
     * \param lm the logmessage
     *
     */
    virtual void OnLog( const HPCLogMessage& lm );

private:
    std::ofstream m_Out; /**< handle of the logfile. */
};

#endif // HPCLOGFILE_H
